package com.github.kezhenxu94.acs;

import java.util.Arrays;

import com.github.kezhenxu94.acs.common.Environment;
import com.github.kezhenxu94.acs.common.Model;

/**
 * Created by kezhenxu on Dec 19, 2016
 *
 * @author kezhenxu (kezhenxu94@163.com)
 */
public class ClusterSolutions implements Model {
	protected Solution[]	solutions;
	protected Environment	environment;

	public ClusterSolutions(Environment environment) {
		this.environment = environment;
		this.solutions = new Solution[environment.getColonySize()];
	}

	public void setSolution(int index, Solution solution) {
		this.solutions[index] = solution;
	}

	public Solution getSolution(int index) {
		return this.solutions[index];
	}

	public Environment getEnvironment() {
		return environment;
	}

	public int getSize() {
		return solutions.length;
	}
	
	@Override
	public String toString() {
		return Arrays.toString(solutions);
	}
}
